home *** CD-ROM | disk | FTP | other *** search
- Path: ghost.shsu.edu!usenet
- From: Rick Mehalick <rmehalic@i-o.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Why don't you use garbage collection
- Date: Tue, 16 Apr 1996 08:14:51 -0500
- Organization: Sam Houston State University
- Message-ID: <31739D4B.2305@i-o.com>
- References: <AD94A731966836BF@dialup97-6-14.swipnet.se> <1996Apr16.110526.1846@ittpub>
- NNTP-Posting-Host: 205.241.79.114
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; SunOS 5.4 sun4d)
-
- Wil Evers wrote:
- >
- > In article <AD94A731966836BF@dialup97-6-14.swipnet.se> lars.farm@nts.mh.se
- > (Lars Farm) writes:
- > > In article <AUSTERN.96Apr12095652@isolde.mti.sgi.com>,
- > > austern@isolde.mti.sgi.com (Matt Austern) wrote:
- > >
- > > >In C++ we're used to the idea that heap-allocated and stack-allocated
- > > >objects have different rules. It's not so radical to introduce
- > > >garbage-collected objects as a third category.
- > >
- > > My sentiments exactly.
- >
- > OK, let's get serious about this:
- >
- > 1. Don't we think C++ is complex enough as it is? In my experience, the
- > main obstacle to get people to use C++ is its steep learning curve, and
- > adding yet a third category of objects wouldn't make things any easier.
- >
- > 2. Will the destructors of garbage collected objects be called?
- >
- > 3. If the answer to (2) is NO: how do we make sure we don't get resource
- > leaks for non-memory resources?
- > To elaborate: IMHO, the type of resources used by a particular class is an
- > implementation detail its users should not have to know or worry about,
- > and implementers should be able to change that without affecting the
- > users.
- > But even if we drop this constraint, derived classes should be able to use
- > additional resource types without changing the `garbage collectability' of
- > objects accessed through the base class interface.
- >
- > 4. If the answer to (2) is YES: when will these destructors be called?
- > What can we assume about the state of the program when the destructor
- > runs? How do we guarantee a shortage of non-memory resources is detected
- > by the garbage collector before we get to the point where the program
- > can't continue?
- >
- > - Wil
-
- Garbage collection for C and C++ caan be done with a product called
- Great Circle. It seems to work very well.
-
- --
- Rick Mehalick
-